package com.woniu.model.gh.common.enums.impl;

import com.woniu.model.gh.common.enums.IResultCode;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

// 通用状态码
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum ResultCode implements IResultCode {

    // 枚举对象:描述状态码、状态码的描述
    SUCCESS(200,"操作成功"),
    FAIL(500,"操作失败"),

    //参数错误：30001-39999
    PARAM_IS_INVALID(30001, "参数无效"),
    PARAM_IS_BLANK(30002, "参数为空"),
    PARAM_TYPE_BIND_ERROR(30003, "参数类型错误"),

    INVENTORY_NOT_ENOUGH(3000, "商品已售罄"),
    HTTP_ALREADY_HANDLE(4000,"请求已处理，请勿重复提交"),
    NO_DATA(40001,"无数据"),
    TYPE_ALREADY_EXISTS(3001, "该品类已存在，请勿重复添加");

    private Integer code;
    private String message;

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

}
